/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package NhanVien;

import java.util.ArrayList;
import java.util.Vector;

/**
 *
 * @author Sinz
 */
public class DSNVnew {
    private ArrayList<NhanVien> dsNV;
    
    public DSNVnew(){
        dsNV = new ArrayList<NhanVien>();
    }
    
    public ArrayList<NhanVien> getDSNV(){
        return this.dsNV;
    }
    
    public void setDSNV(ArrayList<NhanVien> DSNV){
        this.dsNV = DSNV;
    }
    
    //
    public void addNV(NhanVien newNV){
        this.dsNV.add(newNV);
    }
    
    public void removeNV(NhanVien remNV){
        this.dsNV.remove(remNV);
    }
    
    //
    public int getCount(){
        return this.dsNV.size();
    }
    
    public NhanVien getNV(int sott){
        if (sott < 0 || sott > this.dsNV.size()) return null;
        else return this.dsNV.get(sott);
    }
    
    public void printAll(){
        
    }

    public Vector toVector() {
       Vector vTDataNV = new Vector();
       for (NhanVien nv: this.dsNV){
            vTDataNV.add(nv.toVector());
        }
       return vTDataNV;
    }
}
